// /*
//  * Copyright (c) 2025 Huawei Device Co., Ltd.
//  * Licensed under the Apache License, Version 2.0 (the "License");
//  * you may not use this file except in compliance with the License.
//  * You may obtain a copy of the License at
//  *
//  *     http://www.apache.org/licenses/LICENSE-2.0
//  *
//  * Unless required by applicable law or agreed to in writing, software
//  * distributed under the License is distributed on an "AS IS" BASIS,
//  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  * See the License for the specific language governing permissions and
//  * limitations under the License.
//  */

import React, { useState } from 'react';
import { View, Text, Image, StyleSheet, Pressable } from 'react-native';

interface DataObject {
  type: string;
  setTouchit: Function;
}
function Head({ type, setTouchit }: DataObject): JSX.Element {
  const titleText = {
    '0': '纯图片布局',
    '1': '沉浸式打卡布局',
    '2': '白卡上下布局',
  };
  return (
    <View style={{ marginTop: 44, flexDirection: 'row', justifyContent: 'space-between', paddingRight: 16 }}>
      <Pressable style={styles.topLeft} onPress={(): void => setTouchit(null)}>
        <Image style={styles.img} source={require('./left.png')} />
        <Text style={styles.topLeftTitle}>{titleText[type]}</Text>
      </Pressable>
      <Image style={styles.img} source={require('./icon-full.png')} />
    </View>
  );
}
const styles = StyleSheet.create({
  topLeft: {
    paddingHorizontal: 16,
    flexDirection: 'row',
    alignItems: 'center',
  },
  topLeftTitle: {
    marginLeft: 8,
    fontSize: 18,
    fontWeight: 'bold',
  },
  img: {
    width: 40,
    height: 40,
  },
});

export default Head;
